package org.nf.test;

import com.google.gson.Gson;
import org.nf.dao.StaffsDao;
import org.nf.dao.impl.StaffsDaoImpl;
import org.nf.entity.Staffs;

import java.util.List;

/**
 * @author zhu
 * @date 2024-03-07
 */
public class SelectByPage {
    public static void main(String[] args) {
        int page = 2;
        int limit = 4;
        Staffs staffs = new Staffs();
        StaffsDao staffsDao = new StaffsDaoImpl();
        List<Staffs> list = staffsDao.selectByPage(staffs,page,limit);
        Long count  = staffsDao.selectByPageCount(staffs);

        System.out.println(new Gson().toJson(list));
        System.out.println("页码：" + page + ";" + "每页记录" + limit + "条数据");
        System.out.println("总共有" + count + "条数据");
    }
}
